/*

Author   : chaos

FileName : file_io.cpp

Date     : 16/08/17 11:10:46

*/
#include <fstream>
#include <iostream>
using namespace std;

#define size 10
#define filepath "Reader.txt"

int main(int argc ,char *argv[])
{
    fstream file;
    char str[size] = "string",str1[size];

    file.open(filepath ,ios::out | ios::trunc);

    file.write(str,size);
    file.close();

    file.open(filepath,ios::in);
    file.read(str1,size);
    file.close();

    cout << "Reading data from file ..." << endl << str1 << endl;
    return 0;
}
